package net.techwatch.gwt.mvp.client.gin;

import net.techwatch.gwt.mvp.client.service.GreetingServiceAsync;
import net.techwatch.gwt.mvp.client.view.MessageDisplayer;
import net.techwatch.gwt.mvp.client.view.MessageDisplayerImpl;
import net.techwatch.gwt.mvp.client.view.MessageDisplayerWidget;
import net.techwatch.gwt.mvp.client.view.MessageForm;
import net.techwatch.gwt.mvp.client.view.MessageFormImpl;
import net.techwatch.gwt.mvp.client.view.MessageFormWidget;

import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.inject.client.AbstractGinModule;
import com.google.inject.Singleton;

public class MvpModule extends AbstractGinModule {

	@Override
	protected void configure() {
		bind(HandlerManager.class).toProvider(HandlerManagerProvider.class).in(
				Singleton.class);
		bind(GreetingServiceAsync.class).toProvider(GreetingServiceProvider.class).in(
				Singleton.class);

		bind(MessageDisplayer.class).to(MessageDisplayerImpl.class);
		bind(MessageDisplayer.Display.class).to(MessageDisplayerWidget.class);

		bind(MessageForm.class).to(MessageFormImpl.class);
		bind(MessageForm.Display.class).to(MessageFormWidget.class);
	}

}
